/*
* jlb
*/
package com.jlb.user.entity;

import lombok.Data;

/**
 * 矿石 的实体类
 *
 * @author jlb
 */
@Data
public class UserOre implements java.io.Serializable {

    private java.lang.Long id;//数据库字段:id  属性显示:

    private java.lang.String userCode;//数据库字段:user_code  属性显示:用户编码

    private java.lang.Integer ore;//数据库字段:ore  属性显示:矿石总量

    private java.lang.Integer layerTotalOre;//数据库字段:layer_total_ore  属性显示:动态收益总量

    private java.lang.Integer refineTotalOre;//数据库字段:refine_total_ore  属性显示:提炼总数量

    private java.lang.String state;//数据库字段:state  属性显示:状态：激活 Active，停止 Stop

    private String account;

    public UserOre() {
    }

    public UserOre(String userCode, Integer ore, Integer layerTotalOre, String state) {
        this.userCode = userCode;
        this.ore = ore;
        this.layerTotalOre = layerTotalOre;
        this.state = state;
    }


    /**
     * 初始化矿石账户
     *
     * @param userCode 用户编码
     * @return
     */
    public UserOre init(String userCode) {
        this.userCode = userCode;
        this.ore = 0;
        this.layerTotalOre = 0;
        this.refineTotalOre = 0;
        this.state = UserOreState.Active.name();
        return this;
    }
}
